package com.huluobo.a2307douyindemo.register

import androidx.lifecycle.MutableLiveData
import com.huluobo.a2307douyindemo.demo.hilt.UserBeanHit
import com.huluobo.lib_base.bean.UserBean
import com.huluobo.lib_base.mvvm.BaseViewModel
import com.huluobo.lib_base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import okhttp3.RequestBody
import javax.inject.Inject

/**
 *  Created by LC on 2025/9/15.
 */
@HiltViewModel
class RegisterViewModel @Inject constructor(private val apiService: ApiService) : BaseViewModel() {
    val registerSuccess by lazy { MutableLiveData<UserBean>() }

    fun register(body: RequestBody) {
        executeNetwork(
            { apiService.register(body) },
//            { registerSuccess.postValue(it) }
            registerSuccess::postValue
        )
    }
}